package com.travel.travelnetwork.controller.desk;

import com.travel.travelnetwork.pojo.Category;
import com.travel.travelnetwork.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/desk/category")
public class DeskCategoryController {
        @Autowired
        private CategoryService categoryService;

        @RequestMapping("/all")
        @ResponseBody
        public List<Category> all() {
            return categoryService.findAll();
        }
}
